 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">

<head>
<meta http-equiv="Content-Language" content="en-us" />
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Google Link&nbsp; Jira&nbsp;&nbsp; Link&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Wi</title>
<style type="text/css">
.style1 {
	border-style: solid;
	border-width: 1px;
}
.style2 {
	text-align: center;
}
.style3 {
	margin-left: 71px;
}
</style>
<script language="javascript">
	DEFAUTGOOGLE='=hyperlink("';
	JIRALINK= "http://jira.exoplatform.org/browse/";
	WIKILINK= "https://wiki-int.exoplatform.org/display/exoproducts/";
	googleLink =DEFAUTGOOGLE;
	jiraLink = JIRALINK;
	wikiLink = WIKILINK;
	googleLinkJira="";
	jiraLinkPropre="";
	wikiLinkPropre="";
	issueCode="";
	
	function changeJiraLink()
	{
		jiraLink = prompt("Enter new jira link",jiraLink);
		if(jiraLink == "") jiraLink= JIRALINK;
		
	}
	function resetJiraLink()
	{
		jiraLink= JIRALINK;
		alert("Reset Jiralink to " + jiraLink);
	}

	function resetWikiLink()
	{
		wikiLink = WIKILINK;
		alert("Reset Jiralink to " + wikiLink);
	}
	
	function changeWikiLink()
	{
		wikiLink=prompt("Enter new wiki link",wikiLink);
		if(wikiLink=="") wikiLink = WIKILINK;
	}

	function generateLink(idCode,idGoogleLink,idGoogleLink0,idJiraLink,idWikiLink)
	{
		issueCode = document.getElementById(idCode).value;
		if(issueCode == "" )
		{
			alert("Blank Code");
		}else
		{
			jiraLinkPropre = jiraLink + issueCode;
			wikiLinkPropre = wikiLink + issueCode;
			googleLinkJira = googleLink + jiraLinkPropre + '","' + issueCode + '")'; 
			googleWikiJira = googleLink + wikiLinkPropre + '","' + issueCode + '")'; 
			document.getElementById(idGoogleLink).value = googleLinkJira;
			document.getElementById(idGoogleLink0).value = googleWikiJira;
			document.getElementById(idJiraLink).value = jiraLinkPropre;
			document.getElementById(idWikiLink).value = wikiLinkPropre;

		
		}
				
	}
	function removeSpaces(string) {
 		return string.split(' ').join('');
	}
</script>


</script>
</head>

<body>

<table style="width: 100%" class="style1">
	<tr>
		<td style="width: 81px">&nbsp;</td>
		<td style="width: 677px">&nbsp;</td>
		<td>&nbsp;</td>
	</tr>
	<tr>
		<td style="width: 81px">&nbsp;</td>
		<td style="width: 677px" class="style2">
		<form method="post">
			<input id="codeIssue" name="Text1" type="text" style="width: 99px" class="style3" onblur="this.value=removeSpaces(this.value);" />&nbsp;&nbsp;
			<input name="Button1" type="button" value="Generate" onClick="generateLink('codeIssue','txtGoogle','txtGoogle0','txtJira','txtWiki'); return false;" /><br />
			<br />
			<strong>Jira&nbsp;&nbsp; Link&nbsp;&nbsp;&nbsp; </strong>&nbsp;<input name="Text3" type="text" style="width: 272px" id="txtJira" onClick="javascript:this.form.text_area.focus();this.form.text_area.select();" /><img alt="Settings" longdesc="Settings" src="icon_settings-big.png" width="26" height="27" onclick="changeJiraLink();return false;" /><img alt="reset" src="reset_icon_large.jpg" width="33" height="33" onclick="resetJiraLink(); return false;"/><br />
			<strong>Wiki&nbsp; Link&nbsp;&nbsp;&nbsp; </strong>&nbsp;<input name="Text4" type="text" style="width: 272px" id="txtWiki" onClick="javascript:this.form.text_area.focus();this.form.text_area.select();" /><img alt="Settings" longdesc="Settings" src="icon_settings-big.png" width="26" height="27" onclick="changeWikiLink();return false;" /><img alt="reset" src="reset_icon_large.jpg" width="33" height="33" onclick="resetWikiLink(); return false;" /><br />
			<strong>Google Section</strong><br />
			<br />
			<strong>Google Jira</strong>&nbsp;
			<input name="Text2" type="text" style="width: 426px" id="txtGoogle" onClick="javascript:this.form.text_area.focus();this.form.text_area.select();" /><br />
			<strong>Google Wiki</strong>
			<input name="Text5" type="text" style="width: 423px" id="txtGoogle0"  onClick="javascript:this.form.text_area.focus();this.form.text_area.select();"/><br />
			<br />
			<br />
		</form>
		</td>
		<td>&nbsp;</td>
	</tr>
</table>

</body>

</html>
